package part_3;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.text.*;


public class Evaluate {

	public static void main(String[] args) throws IOException {
		// y = x^2 - 3x + 0.3
		// -3 -> 3  per 0.1
		
		double Xvalue = -30;
		double Yvalue;
		int i;
		
		DecimalFormat df = new DecimalFormat(".0");
		BufferedReader inputbuffer = new BufferedReader(new InputStreamReader(System.in));
		
		while (Xvalue <= 30) {
			Yvalue = (Math.pow((Xvalue/10), 2) - (3 * (Xvalue/10)) + 0.3) ;
			System.out.println("x=" + df.format(Xvalue/10) + " => y=" + df.format(Yvalue));
			Xvalue = Xvalue + 1;
		} 
		
		System.out.println("Done evaluating using WHILE(press any key to continu)");
		inputbuffer.readLine();	
		
		Xvalue = -3;
		
		for(i = -3;i <= (56); i++){
			Yvalue = (Math.pow(Xvalue, 2) - (3 * Xvalue) + 0.3) ;
			System.out.println("x=" + df.format(Xvalue) + " => y=" + df.format(Yvalue));
			Xvalue = Xvalue + 0.1;
		}
	}

}
